package catchData.notWellDone;

import java.io.IOException;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.log4j.Logger;

import util.CatchDataUtil;

public class Catch4chinaemed2Login {

	private static Logger LOG = Logger.getLogger("Catch4chinaemed2Login");
	private static HttpClient client;
	private static final String LOGIN_PAGE = "http://ca.chinaemed.com/Login.ashx";
	private static final String HOST = "ca.chinaemed.com";
	private static final String USERNAME = "gdhq_admin";
	private static final String PASSWORD = "88333185";
	private static CatchDataUtil catchData = new CatchDataUtil();
	
	public static void main(String[] args) {
		HttpClient client = catchData.initHttpClient();
		StringBuffer str = new StringBuffer();
		GetMethod get = new GetMethod(LOGIN_PAGE);
		
		try {
			catchData.setHeaders(get,LOGIN_PAGE,HOST);
			client.executeMethod(get);
			str.append(get.getResponseBodyAsString());
			LOG.info(str.toString());
			get.releaseConnection();
		} catch (HttpException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
